From acff088125bb38f2b9e40f49ae9a9159e183b129 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Fri, 10 Nov 2006 15:27:22 +0000 Subject: [PATCH] [IA64,PPC] Fix xencomm_add_offset(). index must be incremented. Signed-off-by: Isaku Yamahata --- xen/arch/ia64/xen/xencomm.c | 7 +++++++ xen/arch/powerpc/usercopy.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/xen/arch/ia64/xen/xencomm.c b/xen/arch/ia64/xen/xencomm.c index 6ef781b0ea..8f6cec8cb7 100644 --- a/xen/arch/ia64/xen/xencomm.c +++ b/xen/arch/ia64/xen/xencomm.c @@ -345,6 +345,11 @@ xencomm_add_offset( unsigned int chunksz; unsigned int chunk_skip; + if (dest_paddr == XENCOMM_INVALID) { + i++; + continue; + } + pgoffset = dest_paddr % PAGE_SIZE; chunksz = PAGE_SIZE - pgoffset; @@ -356,6 +361,8 @@ xencomm_add_offset( desc->address[i] += chunk_skip; } bytes -= chunk_skip; + + i++; } return handle; } diff --git a/xen/arch/powerpc/usercopy.c b/xen/arch/powerpc/usercopy.c index 48ab7579de..d653ed1a05 100644 --- a/xen/arch/powerpc/usercopy.c +++ b/xen/arch/powerpc/usercopy.c @@ -249,6 +249,11 @@ int xencomm_add_offset(void *handle, unsigned int bytes) unsigned int chunksz; unsigned int chunk_skip; + if (dest_paddr == XENCOMM_INVALID) { + i++; + continue; + } + pgoffset = dest_paddr % PAGE_SIZE; chunksz = PAGE_SIZE - pgoffset; @@ -260,6 +265,8 @@ int xencomm_add_offset(void *handle, unsigned int bytes) desc->address[i] += chunk_skip; } bytes -= chunk_skip; + + i++; } return 0; } -- 2.30.2